package com.weitu.permission.user.entity;

import java.io.Serializable;

/**
 * Table: SYS_USER_ROLE
 */
public class UserRole implements Serializable {
    /**
     * Column: SYS_USER_ROLE.deptId
     */
    private String deptId;

    /**
     * Column: SYS_USER_ROLE.userId
     */
    private String userId;

    /**
     * Column: SYS_USER_ROLE.roleId
     */
    private String roleId;

    private String roleName;

    /**
     * Table: SYS_USER_ROLE
     */
    private static final long serialVersionUID = 1L;

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId == null ? null : deptId.trim();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId == null ? null : roleId.trim();
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserRole userRole = (UserRole) o;

        if (deptId != null ? !deptId.equals(userRole.deptId) : userRole.deptId != null) return false;
        if (userId != null ? !userId.equals(userRole.userId) : userRole.userId != null) return false;
        if (roleId != null ? !roleId.equals(userRole.roleId) : userRole.roleId != null) return false;
        return roleName != null ? roleName.equals(userRole.roleName) : userRole.roleName == null;
    }

    @Override
    public int hashCode() {
        int result = deptId != null ? deptId.hashCode() : 0;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (roleId != null ? roleId.hashCode() : 0);
        result = 31 * result + (roleName != null ? roleName.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("UserRole{");
        sb.append("deptId='").append(deptId).append('\'');
        sb.append(", userId='").append(userId).append('\'');
        sb.append(", roleId='").append(roleId).append('\'');
        sb.append(", roleName='").append(roleName).append('\'');
        sb.append('}');
        return sb.toString();
    }
}